var QRCode = require('../qrcode.js');
var qiniuServer = require('../../server/qiniuServer');

exports.draw=function(){
    QRCode.toDataURL('i am a pony!', {"scale":8},function(err,data){
        console.log(data.replace("data:image/png;base64,",""));
        qiniuServer.up2Weima("test6.png",new Buffer(data.replace("data:image/png;base64,",""),'base64'),function(err,data){
            console.log(err+"------------"+data);
        });
    });}


exports.draw2weima=function(url,fileName,callback){
    QRCode.toDataURL(url, {"scale":6},function(err,data){
        qiniuServer.up2Weima(fileName,new Buffer(data.replace("data:image/png;base64,",""),'base64'),function(err,data){
            callback(err,data);
        });
    });}